Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

318
Views
How do I build an NPM package that can access a [my package]-conf.js file in the root of the main project
// this is for a Vue 3 project - not sure if that's important for the answer

// APPENDIX: 
//   package = npm package
//   project = vue 3 project that will import the npm package

I'm building an npm package that has reusable vue components using vue-sfc-rollup.

To allow for customisation I want to give the user the ability to make a config file in the root (same level as the package.json of the project) which can then be accessed by the package.

I was hoping it would look something like this.

import config from '@/my-package-conf.js' where @ (or other symbol) would indicate the root of the project

I assume this can be done using a relative path but that won't be particularly easy for my implementation.

Thanks for any help you can provide!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!